package com.vcredit.creditcat.enumtype;

/**
 * 婚姻状况转换统一枚举
 */
public enum CommonMarriageConvertEnum {

	UNMARRIED(1, 3, "未婚"), 
	MARRIED(2, 2, "已婚"), 
	DIVORCE(3, 4, "离异"), 
	WIDOWED(4, 4, "丧偶");
	
	private Integer scode;
	private Integer tcode;
	private String desc;
	/**
	 * @param scode
	 * @param tcode
	 * @param desc
	 */
	private CommonMarriageConvertEnum(Integer scode, Integer tcode, String desc) {
		this.scode = scode;
		this.tcode = tcode;
		this.desc = desc;
	}
	public Integer getScode() {
		return scode;
	}
	public Integer getTcode() {
		return tcode;
	}
	public String getDesc() {
		return desc;
	}
	
	public static Integer getTcodeByScode(Integer scode) {
		for(CommonMarriageConvertEnum marriageEnum : CommonMarriageConvertEnum.values()) {
			if(marriageEnum.getScode() == scode) {
				return marriageEnum.getTcode();
			}
		}
		return 0;
	}
}
